home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
M2Crypto
/
ftpslib.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
62 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
from ftplib import *
from ftplib import parse150, parse227
from ftplib import error_reply, error_temp, error_perm, error_proto
import socket
import time
import SSL
DEFAULT_PROTOCOL = 'sslv23'
class FTP_TLS(FTP):
def __init__(self, host = None, ssl_ctx = None):
if ssl_ctx is not None:
self.ssl_ctx = ssl_ctx
else:
self.ssl_ctx = SSL.Context(DEFAULT_PROTOCOL)
if host:
self.connect(host)
self.prot = 0
def auth_tls(self):
self.voidcmd('AUTH TLS')
s = SSL.Connection(self.ssl_ctx, self.sock)
s.setup_ssl()
s.set_connect_state()
s.connect_ssl()
self.sock = s
self.file = self.sock.makefile()
def auth_ssl(self):
raise NotImplementedError
def prot_p(self):
self.voidcmd('PBSZ 0')
self.voidcmd('PROT P')
self.prot = 1
def prot_c(self):
self.voidcmd('PROT C')
self.prot = 0
def ntransfercmd(self, cmd, rest = None):
(conn, size) = FTP.ntransfercmd(self, cmd, rest)
if self.prot:
conn = SSL.Connection(self.ssl_ctx, conn)
conn.setup_ssl()
conn.set_connect_state()
conn.set_session(self.sock.get_session())
conn.connect_ssl()
return (conn, size)